package com.example.chatzsyproject.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.chatzsyproject.R;
import com.example.chatzsyproject.adapter.ChatFileAdapter;
import com.example.chatzsyproject.adapter.CircleOffFriendsAdapter;
import com.example.chatzsyproject.base.BaseActivity;
import com.example.chatzsyproject.model.ChatFileModel;
import com.example.chatzsyproject.model.CircleOffFriendModel;
import com.example.chatzsyproject.view.AZListView.azlist.AZTitleDecoration;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 聊天文件
 */
public class ChatFileActivity extends BaseActivity {
    @BindView(R.id.tv_title)
    TextView tv_title;

    ChatFileAdapter mAdapter;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    private List<ChatFileModel> list = new ArrayList<>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chatfile);
        ButterKnife.bind(this);
        init();
    }

    public void init() {
        tv_title.setText("聊天文件");
        recyclerView.setLayoutManager(new LinearLayoutManager(ChatFileActivity.this));
        recyclerView.addItemDecoration(new AZTitleDecoration(new AZTitleDecoration.TitleAttributes(ChatFileActivity.this)));
        mAdapter = new ChatFileAdapter(R.layout.adapter_chatfile, list);
        recyclerView.setAdapter(mAdapter);
        mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                //商品点击事件
            }
        });
        getData();
    }

    public void getData() {
        for (int i = 0; i < 5; i++) {
            ChatFileModel model = new ChatFileModel();
            list.add(model);
        }
        mAdapter.notifyDataSetChanged();
    }
}
